<script src="/misc/js/order.js"></script>
<link rel="stylesheet" href="/v2/css/member.css?1111">
<div class="order_top_count">
    <div class="order_top">
        <div class="order_a_l">
            <a href="/member/order/index.html"><img src="/misc/images/order_top_l.png?222" /></a>
        </div>
        <div class="order_cen">订单详情</div>
    </div>
</div>
<div class="clear"></div>
<div class="or_de_p_z">
    <div class="or_de_p_t">
        <div class="or_de_p_t_l">
            <?php if($item['status'] == OrderModel::STATUS_CANCELLED):?>
                <span style="color:red;">订单关闭</span>
            <?php elseif($item['status'] == OrderModel::STATUS_COMPLETED):?>
                <span class="status_complete"><?=OrderModel::$status_text[$item['status']]?></span>
            <?php else:?>
                <span class="status_waitpay"><?=OrderModel::$status_text[$item['status']]?></span>
            <?php endif;?>
        </div>
        <div class="or_de_p_t_r">订单号：<?=$item['sn']?></div>
    </div>

</div>
<div class="or_de_xq">
    <div class="or_de_xq_x">
        <div class="or_de_xq_i">订单金额：</div>
        <div class="or_de_xq_xl">￥<?=price_format($item['amount'])?></div>
    </div>
    <div class="or_de_xq_x">
        <div class="or_de_xq_i2">支付方式：</div>
        <div class="or_de_xq_xl2"><?=$payment?></div>
    </div>
    <?php if(!empty($item['address'])){?>
        <div class="address_row">

            <div class="or_de_xq_x">
                <div class="or_de_xq_i3">激活信息：</div>
                <div class="or_de_xq_xl3">
                    <?=$item['address']['consignee']?>  <?=$item['address']['mobile']?> <?=$item['address']['idnum']?>
                </div>
            </div>
        </div>
    <?php }?>
    <div class="or_de_xq_x">
        <div class="or_de_xq_i7">下单时间：</div>
        <div class="or_de_xq_xl7"><?=$item['create_time']?></div>
    </div>
</div>
<div class="or_de_sp">
    <div class="or_de_sp_top">
        <div class="or_de_sp_l">商品信息</div>
        <div class="or_de_sp_r">共<?=$item['count_num']?>件</div>
    </div>
    <?php foreach($item['products'] as $product):?>
    <div class="order_c_pic_tit">
        <div class="order_c_p_l">
            <a href="/product/detail/goods_id/<?=$product['product_id']?>.html">
                <img  src="<?=$product['product_thumb']?>">
            </a>
        </div>
        <div class="order_c_p_r">
            <div class="order_c_p_r_t">
                <div class="order_c_p_r_tit">
                    <a href="/product/detail/goods_id/<?=$product['product_id']?>.html">
                        <?=$product['product_name']?>
                    </a>
                </div>
                <div class="order_c_p_r_pri">￥ <?=price_format($product['price'])?></div>
                <div class="order_c_p_r_pri"><?=$product['num']?>件</div>
            </div>
        </div>
    </div>
    <?php if(!$item['has_remark'] && $item['status'] == OrderModel::STATUS_COMPLETED):?>
    <div class="or_de_xq">
        <form action="/member/order/remark/sn/<?=$item['sn']?>.html" method="post" class="remark_form">
            <input type="hidden" name="product_id" value="<?=$product['product_id']?>" >
            <div class="form-group" style="margin-top: 20px;">
                <input name="rate" value="1" type="radio" checked /> 好评
                &nbsp; &nbsp;&nbsp;
                <input name="rate" value="0" type="radio" /> 中评
                &nbsp; &nbsp;&nbsp;
                <input name="rate" value="-1" type="radio" /> 差评
            </div>
            <div class="form-group">
                <textarea name="remark" placeholder="请填写评价内容" maxlength="200" class="form-control" rows="3"></textarea>
            </div>
            <button class="btn btn-warning btn-block sb_remark_btn" type="submit">
                提交评论
            </button>
        </form>
    </div>
    <?php endif;?>
    <?php endforeach;?>
    <div class="or_de_ft">
        <div class="or_de_ft_l">商品总额：</div>
        <div class="or_de_ft_r">
            <div class="or_de_ft_r_t">￥<?=price_format($item['amount'])?></div>
            <div class="or_de_ft_r_b"><span class="">实付：</span><span class="or_de_ft_r_b_s">￥<?=price_format($item['amount'])?></span></div>
        </div>
    </div>
    <?php if($item['status'] == OrderModel::STATUS_WATI_PAY && $item['pay_status'] == OrderModel::PAY_STATUS_NO_PAY):?>
    <div class="btn_wrap" id="refundBtn" style="height: 60px; line-height: 60px; padding: 0 20px;"">
        <div class="fr mobile_operation" >
            <span class="J_closeOrder btn btn-default" order_sn="<?=$item['sn']?>">取消订单</span>
            <span class="J_payOrder btn btn-warning" order_sn="<?=$item['sn']?>">去付款</span>
        </div>
    </div>
    <?php endif;?>
</div>

<script type="text/javascript">
    $(document).ready(function(){
        $('.J_closeOrder').css('margin-right','10px');
        $(".remark_form").submit(function(){
            var obj = $(this);
            var sb_btn = $(".sb_remark_btn");
            sb_btn.attr('disabled', true);
            showPageLoadingMsg('请稍候...');
            $.post(this.action,$(this).serialize(),function(resp){
                if(resp.status == 1){
                    obj.closest('.or_de_xq').slideUp(1000,function(){
                        $(this).remove();
                    });
                }
                floatNotify.simple(resp.msg);
            },'json').always(function () {
                sb_btn.attr('disabled', false);
                $(".ui-loader").remove();
            })
            return false;
        })
    });
</script>
